package com.lyz.dataStructure.algorithm.五八同城2020;/**
 * @Author:759057893@qq.com Lyz
 * @Date: ${Date} 20:47
 * @Description:
 **/

import java.util.Scanner;

/**
 *@Author:759057893@qq.com Lyz
 *@Date: 2019/9/12 20:47
 *@Description:
 **/
public class 数组去重 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.nextLine();
        String[] st =s.split(",");
        int[] arr = new int[st.length];
        for(int i =0;i<arr.length;i++){
            arr[i] = Integer.parseInt(st[i]);
        }
        System.out.println(removeNum(arr));
    }

    public static int removeNum(int[] array){
        if(array==null||array.length==0) return 0;
        int pre =0,cur =1;
        int pos =1;
        while (cur<array.length){
            if(array[cur]!=array[pre]){
                array[pos++] = array[cur];
            }
            pre++;
            cur++;
        }
        return pos;
    }

}
